﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EasyTest.Application.Service;
/// <summary>
/// 题目分类表
/// </summary>
[SugarTable(null, "题目分类表")]
[SysTable]
[SugarIndex("index_{table}_N", nameof(Name), OrderByType.Asc)]
[SugarIndex("index_{table}_P", nameof(ParentId), OrderByType.Asc)]
[SugarIndex("index_{table}_QB", nameof(QuestionBankId), OrderByType.Asc)]
public partial class EtQuestionCate : EntityTenantBaseData
{
    /// <summary>
    /// 名称
    /// </summary>
    [SugarColumn(ColumnDescription = "名称", Length = 128)]
    [Required, MaxLength(128)]
    public virtual string Name { get; set; }

    /// <summary>
    /// 描述
    /// </summary>
    [SugarColumn(ColumnDescription = "描述", Length = 512)]
    public virtual string? Description { get; set; }

    /// <summary>
    /// 状态（启用/禁用）
    /// </summary>
    [SugarColumn(ColumnDescription = "状态")]
    public StatusEnum Status { get; set; } = StatusEnum.Enable;

    /// <summary>
    /// 父级分类ID
    /// </summary>
    [SugarColumn(ColumnDescription = "父级分类ID")]
    public virtual long? ParentId { get; set; } = 0;

    /// <summary>
    /// 排序
    /// </summary>
    [SugarColumn(ColumnDescription = "排序")]
    public int OrderNo { get; set; } = 100;

    /// <summary>
    /// 题库ID
    /// </summary>
    [SugarColumn(ColumnDescription = "题库ID")]
    [Required]
    public virtual long? QuestionBankId { get; set; }

    /// <summary>
    /// 题库分类子项
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    public List<EtQuestionCate> Children { get; set; } = new List<EtQuestionCate>();
}